package com.bdqn.crm.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName orders
 */
@TableName(value = "orders")
@Data
public class Orders implements Serializable {
    /**
     * 订单编号
     */
    @TableId(type = IdType.AUTO)
    private Long odrId;

    /**
     * 客户编号
     */
    private String odrCustomer;

    /**
     * 日期
     */
    private Date odrDate;

    /**
     * 送货地址
     */
    private String odrAddr;

    /**
     * 状态
     */
    private String odrStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Orders other = (Orders) that;
        return (this.getOdrId() == null ? other.getOdrId() == null : this.getOdrId().equals(other.getOdrId()))
                && (this.getOdrCustomer() == null ? other.getOdrCustomer() == null : this.getOdrCustomer().equals(other.getOdrCustomer()))
                && (this.getOdrDate() == null ? other.getOdrDate() == null : this.getOdrDate().equals(other.getOdrDate()))
                && (this.getOdrAddr() == null ? other.getOdrAddr() == null : this.getOdrAddr().equals(other.getOdrAddr()))
                && (this.getOdrStatus() == null ? other.getOdrStatus() == null : this.getOdrStatus().equals(other.getOdrStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOdrId() == null) ? 0 : getOdrId().hashCode());
        result = prime * result + ((getOdrCustomer() == null) ? 0 : getOdrCustomer().hashCode());
        result = prime * result + ((getOdrDate() == null) ? 0 : getOdrDate().hashCode());
        result = prime * result + ((getOdrAddr() == null) ? 0 : getOdrAddr().hashCode());
        result = prime * result + ((getOdrStatus() == null) ? 0 : getOdrStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", odrId=").append(odrId);
        sb.append(", odrCustomer=").append(odrCustomer);
        sb.append(", odrDate=").append(odrDate);
        sb.append(", odrAddr=").append(odrAddr);
        sb.append(", odrStatus=").append(odrStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}